<?php

// GNU [A]GPLv+3 here

function Download()
{
	header("Content-Type: application/octet-stream");

	$ContentArchive	= stripslashes($_GET['ContentArchive']);

	$Blocks = explode(',', $_GET['Blocks']);

	for ( $I = 0; $I < count($Blocks); $I++ )
	{
		$BlockId	=	$Blocks[$I];

		$FileName = $ContentArchive . '/' . $BlockId . '.xz';
		
		echo $BlockId . chr(0)  . filesize($FileName) . chr(0);

		echo file_get_contents($FileName);
	}
}

?>
